<template>
    <el-cascader v-model="select" :options="list" :props="{
        value:'id',
        label:'name'
    }"></el-cascader>
</template>
<script>
import { post } from '@/assets/js/http';

export default{
    data(){
        return{
            select:[],
            list:[]
        }
    },
    created(){
        this.getList()
    },
    watch:{
        select(){
            this.$emit('input',this.select[this.select.length-1])
        }
    },
    methods:{
        async getList(){
            let data =await post({
                url:'/admin/store.MerchantCate/index',
                data:{
                    page:1,
                    limit:999
                }
            })
            this.list=data.list
        }
    }
}
</script>